package iscript.uiFramework.components.core
{
	import flash.display.BitmapData;
	import flash.display.DisplayObject;
	import flash.geom.Point;
	import flash.ui.Mouse;
	import flash.ui.MouseCursor;
	import flash.ui.MouseCursorData;
	import iscript.uiFramework.UIFramework;
	
	public class CursorManager
	{
		
		static private var _Initialized:Boolean;
		static private function initialize():void
		{
			var mousedata:MouseCursorData;
			var bds:Vector.<BitmapData> = new Vector.<BitmapData>();
				bds.push(UIFramework.resource.getBitmapData("GameLite.UIComponent.Cursors.HResize"));
			    mousedata = new MouseCursorData();
				mousedata.data = bds;
				mousedata.hotSpot = new Point(bds[0].width / 2, bds[0].height / 2);
			Mouse.registerCursor("HResize", mousedata);
			
			bds= new Vector.<BitmapData>();
			bds.push(UIFramework.resource.getBitmapData("GameLite.UIComponent.Cursors.VResize"));
			mousedata = new MouseCursorData()
			mousedata.data = bds;
			mousedata.hotSpot = new Point(bds[0].width / 2, bds[0].height / 2);
			Mouse.registerCursor("VResize", mousedata);
			
			_Initialized = true;
		}
			
		
		
		static public const  HResize:String = "HResize";
		static public const  VResize:String = "VResize";
		
		public function CursorManager()
		{
		
		}
		
		static public function setCursor(name:String):void
		{
	        if (!_Initialized) initialize();
			Mouse.cursor = name;
		
		}
		
 
		
		
		static public function normal():void
		{
			Mouse.cursor = MouseCursor.AUTO;
		}
	
	}

}